package com.jiangwz.entity;

import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author jiangwz
 * @create 2019/9/10.
 */
//@Component
public class Dog {

    @Autowired()
    Person p;

    private String name;

    public void eat(){
        System.out.println("dog name=" + this.name);
        System.out.println(p.getName());
    }

    public String getName() {
        return name;
    }

    public Dog setName(String name) {
        this.name = name;
        return this;
    }

    @Override
    public String toString() {
        return "Dog{" +
                "name='" + name + '\'' +
                '}';
    }
}
